<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>添加活动场次页面</title>
<link rel="stylesheet" href="layui/css/layui.css" />
</head>
<body>
	<form class="layui-form"  style="margin-top: 20px;">
		<div class="layui-form-item">
			<label class="layui-form-label">场次名称：</label>
			<div class="layui-input-inline">
				<input type="text" name="as_name" id="as_name" required
					lay-verify="required" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">场次时间：</label>
			<div class="layui-input-inline">
				<input type="text" name="as_time" id="as_time" required
					lay-verify="required" class="layui-input" placeholder="yyyy-MM-dd HH:mm:ss">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">场次地址：</label>
			<div class="layui-input-inline">
				<input type="text" name="as_url" id="as_url" required
					lay-verify="required" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit lay-filter="forDemo">提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
	<script type="text/javascript" src="layui/layui.js"></script>
	<script>
		layui.use([ 'form', 'upload' ], function() {
			var form = layui.form;
			var $ = layui.jquery;
			var upload = layui.upload;

			//监听提交
			form.on('submit(forDemo)', function(data) {
				var d = data.field;
				d.method = "addActivitySess";
				console.log(d);
				var url = '/wk1un2_electricity_digital/Backstage/addActivitySess';
				$.post(url, d, function(data) {
					if (data.count > 0) {
						console.log('添加成功');
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
					}
				}, "json");
				return false;
			});
		});
	</script>
  <script>
  layui.use('laydate', function(){
    var laydate = layui.laydate;
    
    //日期时间选择器
    laydate.render({
      elem: '#as_time'
      ,type: 'datetime'
    });

 
   
  });
  </script>
	
</body>
</html>